/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication1;

/**
 *
 * @author user
 */
public class bai9 {
    public static void main(String[] args) {
        System.out.println(tinhBieuThuc(3, 2));
    }
    
    private static double tinhBieuThuc(int x,int n){
        if(n==0) return 1;
        return Math.pow(x, 2*n)/giaithua(2*n)+tinhBieuThuc(x, n-1);
    }
    
    private static int giaithua(int n){
        if(n==1) return 1;
        return n*giaithua(n-1);
    }
}
